drop table jms_dm.dm_cn_leave_message_receive_receive_agent_agg_dt;
CREATE EXTERNAL TABLE jms_dm.dm_cn_leave_message_receive_receive_agent_agg_dt
(
    `leave_message_type`            int comment '留言类型:1、破损 2、延误 3、遗失 4、其他',
    `receive_agent_code`            string comment '接受网点大区code',
    `receive_agent_name`            string comment '接受网点大区名称',
    `receive_financial_center_code` string comment '接受网点代理区code',
    `receive_financial_center_name` string comment '接受网点代理区名称',
    `message_cnt`                   bigint comment '留言总数',
    `receive_reply_cnt`                     bigint comment '接受方已回复数',
    `receive_unreply_cnt`                   bigint comment '接受方未回复数',
    `receive_end_cnt`                       bigint comment '接受方已完结数',
    `receive_reply_rate`                    double comment '接受方回复率',
    `receive_end_rate`                      double comment '接受方完结率'
)
    COMMENT '留言（接受时间接受代理区汇总）'
    PARTITIONED BY (
        `dt` string COMMENT 'latest_reply_time接受时间日期分区')
    ROW FORMAT SERDE
        'org.apache.hadoop.hive.ql.io.parquet.serde.ParquetHiveSerDe'
    STORED AS INPUTFORMAT
        'org.apache.hadoop.hive.ql.io.parquet.MapredParquetInputFormat'
        OUTPUTFORMAT
            'org.apache.hadoop.hive.ql.io.parquet.MapredParquetOutputFormat'
    LOCATION
        '/dw/hive/jms_dm.db/external/dm_cn_leave_message_receive_receive_agent_agg_dt';
